Import('RTT_ROOT')
from building import *

cwd = GetCurrentDir()
src = Split("""
core/core.c
core/driver.c
core/usbhost.c
core/hub.c
core/hcd.c
core/urb.c
core/usbmsg.c
""")

if GetDepend('RT_USBH_ADK'):
	src += Glob('class/adk.c')
	src += Glob('class/adkapp.c')

if GetDepend('RT_USBH_MSTORAGE'):
	src += Glob('class/mass.c')
	src += Glob('class/udisk.c')

if GetDepend('RT_USBH_HID'):
	src += Glob('class/hid.c')

if GetDepend('RT_USBH_HID_MOUSE'):
	src += Glob('class/umouse.c')

if GetDepend('RT_USBH_HID_KEYBOARD'):
	src += Glob('class/ukbd.c')

if GetDepend('RT_USBH_CDCACM'):
	src += Glob('class/cdc_acm.c')

CPPPATH = [cwd, cwd + '/class', cwd + '/core', \
	cwd + '/include', cwd + '../../../include']

group = DefineGroup('usbhost', src, depend = ['RT_USING_USB_HOST'], CPPPATH = CPPPATH)

Return('group')
